package cn.wolfcode.wolf2w.controller;

import cn.wolfcode.wolf2w.annotation.LoginAnnotation;
import cn.wolfcode.wolf2w.annotation.UserParams;
import cn.wolfcode.wolf2w.domain.Banner;
import cn.wolfcode.wolf2w.domain.Travel;
import cn.wolfcode.wolf2w.domain.TravelComment;
import cn.wolfcode.wolf2w.domain.UserInfo;
import cn.wolfcode.wolf2w.query.TravelQuery;
import cn.wolfcode.wolf2w.redis.service.IUserInfoRedisService;
import cn.wolfcode.wolf2w.service.*;
import cn.wolfcode.wolf2w.util.JsonResult;
import cn.wolfcode.wolf2w.util.UMEditorUploader;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.util.List;


/**
 * Created by 甘静斌 on 2020-08-11 21:19
 */
@RestController
@RequestMapping("index")
public class IndexController {
    
   @Autowired
   private IBannerService bannerService;


    /**
     * banner-游记推荐四篇进行列表
     * @return
     */
    @GetMapping("/banners/travel")
    public Object queryByTravel(){

        List<Banner> list = bannerService.queryByStrategyBanner(Banner.TYPE_TRAVEL);
        return JsonResult.success(list);
    }

    /**
     * banner - 攻略推荐
     * @return
     */
    @GetMapping("/banners/strategy")
    public Object queryByStrategy(){

        Banner banner = bannerService.queryByStrategyBanner(Banner.TYPE_STRATEGY).get(0);
        return JsonResult.success(banner);
    }

}
